<h2 class="accessibility">{$lang.select_notification}</h2>

<p class="pageoptions">
    <a class="pageoptions" href="{$actionUrls.new}" title="{$lang.new_subscription}">
        <img class="systemicon" src="themes/NCleanGrey/images/icons/system/newobject.gif" alt="{$lang.new_subscription}" />
    </a>
    <a class="pageoptions" href="{$actionUrls.new}" title="{$lang.new_subscription}">
        {$lang.new_subscription}
    </a>
</p>

{if $subs|@count == 0}
	<p><a href="{$actionUrls.new}">{$lang.new_subscription}</a></p>
{else}
<table id="subscriptions-list">
<tbody>
<tr>
	<th>{$lang.title}</th>
    <th class="num">{$lang.groups}</th>
	<th class="num">{$lang.duration}</th>
	<th class="num">{$lang.num_subscribers}</th>

	<th class="actions">{$lang.active}</th>
	<th class="actions">{$lang.edit}</th>
</tr>
{capture assign="even"}odd{/capture}
{section loop=$subs name=i}
    
    {if $even=="odd"}
		{capture assign="even"}even{/capture}
	{else}
		{capture assign="even"}odd{/capture}
	{/if}
	<tr>
		<td class="{$even} title">
			{$subs[i].title}
		</td>
		<td class="{$even} num">
		  {section loop=$subs[i].groups name=i2}
		      {$subs[i].groups[i2]}<br />
		  {/section}
		</td>
                <td class="{$even} num">
                    {if $can_manage_users}
                        <a href="javascript: void(null)" onclick="ISubscribe_Admin.toggleViewUsers({$subs[i].id})">{$lang.view}</a>
                        <a href="javascript: void(null)" onclick="ISubscribe_Admin.toggleAddUser({$subs[i].id})">{$lang.add}</a>
                        <div id="ISubscribeViewUsers_{$subs[i].id}" style="display: none; position: relative">
                            <div style="position: absolute; background: white;">{$subs[i].viewUsers}</div>
                        </div>
                        <div id="ISubscribeAddUser_{$subs[i].id}" style="display: none; position: relative">
                            <div style="position: absolute; background: white;">{$subs[i].addUser}</div>
                        </div>
                    {/if}
                </td>
		<td class="{$even} num">
			{$subs[i].duration} days
		</td>
		<td class="{$even} num">
		  {$subs[i].num_subscribers|@intval}
		</td>
		<td class="{$even} actions">
		  <a href="{$subs[i].toggleActivateUrl}" title="{$subs[i].toggleActivateText}">
            <img src="{$subs[i].toggleActivateImg}" alt="{$subs[i].toggleActivateText}" />
          </a>
		</td>
		<td class="{$even} actions">
		  <a href="{$subs[i].editUrl}" title="{$lang.edit_subscription}">
            <img src="themes/NCleanGrey/images/icons/system/edit.gif" 
            alt="{$lang.edit_subscription}" />
          </a>
		</td>
	</tr>
{/section}
</tbody>
</table>
{/if}
